<%--
  Created by IntelliJ IDEA.
  User: xiaoji
  Date: 2014/11/24
  Time: 14:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<c:set value="${pageContext.request.contextPath}" var="path" scope="session"/>
<!DOCTYPE html>

<html>
<head>
    <title>用户管理</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="${path}/plugins/jquery-easyui-1.4.1/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="${path}/plugins/jquery-easyui-1.4.1/themes/icon.css">
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/jquery.min.js"></script>
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${path}/plugins/jquery-easyui-1.4.1/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
        $(function(){
            //查询
            $("#search").click(function(){
                var currenttab =  $("#search").attr("stab");
                $('#'+currenttab).datagrid('load',{
                    title:$("#title").val()
                });
            });
            //切换
            $('#tabs').tabs({
                onSelect: function (title) {
                    if(title=="全部"){
                        $('#ttAll').datagrid({
                            url:'${path}/task/view.do',
                            method:'get'
                        });
                        $("#search").attr("stab","ttAll");
                    }else if(title=="任务编写"){
                        $('#tt105101').datagrid({
                            url:'${path}/task/view.do?progress=105101',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105101");
                    }else if(title=="发布项目"){
                        $('#tt105102').datagrid({
                            url:'${path}/task/view.do?progress=105102',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105102");
                    }else if(title=="托管定金"){
                        $('#tt105103').datagrid({
                            url:'${path}/task/view.do?progress=105103',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105103");
                    }else if(title=="审核"){
                        $('#tt105104').datagrid({
                            url:'${path}/task/view.do?progress=105104',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105104");
                    }else if(title=="艺术家报价（招标）"){
                        $('#tt105105').datagrid({
                            url:'${path}/task/view.do?progress=105105',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105105");
                    }else if(title=="选定艺术家"){
                        $('#tt105106').datagrid({
                            url:'${path}/task/view.do?progress=105106',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105106");
                    }else if(title=="任务签约"){
                        $('#tt105107').datagrid({
                            url:'${path}/task/view.do?progress=105107',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105107");
                    }else if(title=="（任务房间）艺术家工作"){
                        $('#tt105108').datagrid({
                            url:'${path}/task/view.do?progress=105108',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105108");
                    }else if(title=="验收"){
                        $('#tt105109').datagrid({
                            url:'${path}/task/view.do?progress=105109',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105109");
                    }else if(title=="评价"){
                        $('#tt105110').datagrid({
                            url:'${path}/task/view.do?progress=105110',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105110");
                    }else if(title=="交易完成"){
                        $('#tt105111').datagrid({
                            url:'${path}/task/view.do?progress=105111',
                            method:'get'
                        });
                        $("#search").attr("stab","tt105111");
                    }
                }
            });
        });

        //通过审核
        function examine(id,userId,title,lastIndex){
            if(confirm("是否审核通过项目《"+title+"》")){
                $.post("${path}/task/examine.do",{
                    id:id,
                    userId:userId,
                    title:title
                },function(data){
                    if(data.errormsg == undefined){
                        $('#tt105104').datagrid('updateRow', {
                            index:lastIndex,
                            row : {
                                progress:"艺术家报价（招标）",
                                STATUS : "进行中"
                            }
                        });
                    }else{
                        alert(data.errormsg);
                    }
                },"json");
            }

        }
        //推荐
        function recommend(id,title,lastIndex){
            if(confirm("是否推荐项目《"+title+"》")) {
                $.post("${path}/task/recommend.do",{
                    id:id
                },function(data){
                    if(data.errormsg == undefined){
                        $('#tt105105').datagrid('updateRow', {
                            index:lastIndex,
                            row:{
                                isRecom:101001
                            }
                        });
                    }else{
                        alert(data.errormsg);
                    }
                },"json");
            }

        }

        //取消推荐
        function unrecommend(id,title,lastIndex){
            if(confirm("是否取消推荐项目《"+title+"》")) {
                $.post("${path}/task/cancelRecommend.do",{
                    id:id
                },function(data){
                    if(data.errormsg == undefined){
                        $('#tt105105').datagrid('updateRow', {
                            index:lastIndex,
                            row:{
                                isRecom:101002
                            }
                        });
                    }else{
                        alert(data.errormsg);
                    }
                },"json");
            }

        }
    </script>
</head>
<body class="easyui-layout">
<div region="center" style="padding:5px;" border="false">
    <div id="tabs" class="easyui-tabs" style="width:100%;height:700px">
        <div title="全部" style="padding:10px">
            <!--列表-->
            <table id="ttAll" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:'${path}/task/view.do',
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="任务编写" style="padding:10px">
            <table id="tt105101" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="发布项目" style="padding:10px">
            <table id="tt105102" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="托管定金" style="padding:10px">
            <table id="tt105103" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="审核" style="padding:10px">
            <table id="tt105104" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:180,formatter: rowformatter4">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="艺术家报价（招标）" style="padding:10px">
            <table id="tt105105" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:180,formatter: rowformatter5">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="选定艺术家" style="padding:10px">
            <table id="tt105106" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="任务签约" style="padding:10px">
            <table id="tt105107" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="（任务房间）艺术家工作" style="padding:10px">
            <table id="tt105108" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="验收" style="padding:10px">
            <table id="tt105109" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="评价" style="padding:10px">
            <table id="tt105110" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        </div>
        <div title="交易完成" style="padding:10px">
            <table id="tt105111" class="easyui-datagrid"
                   data-options="singleSelect:true,collapsible:true,url:null,
       method:'get',toolbar:'#tb',pagination:'true',fit:'true'">
                <thead>
                <tr>
                    <th data-options="field:'title',align:'center',width:80">项目名</th>
                    <%--<th data-options="field:'demand',align:'center',width:80">项目要求</th>--%>
                    <th data-options="field:'pic',align:'center',width:80,formatter:function(v){return '<img width=\'30px\' height=\'30px\' src=/'+v+'>'}">图片</th>
                    <th data-options="field:'firstClass',align:'center',width:80">一级分类</th>
                    <th data-options="field:'secondClass',align:'center',width:80">二级分类</th>
                    <th data-options="field:'style',align:'center',width:80">风格</th>
                    <th data-options="field:'skillName',align:'center',width:80">技能</th>
                    <th data-options="field:'progress',align:'center',width:80">进度</th>
                    <th data-options="field:'property',align:'center',width:80">外包类型</th>
                    <th data-options="field:'STATUS',align:'center',width:80">状态</th>
                    <th data-options="field:'publish_time',align:'center',width:80">发布时间</th>
                    <th data-options="field:'bid_time',align:'center',width:80">竞标时间（天）</th>
                    <th data-options="field:'lang',align:'center',width:80">任务国际</th>
                    <th data-options="field:'userName',align:'center',width:80">发包方</th>
                    <th data-options="field:'isPiece',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否计件</th>
                    <th data-options="field:'isRecom',align:'center',width:80,formatter:function(v){if(v == 101001) return '是'; else return '否';}">是否推荐</th>
                    <th data-options="field:'id',align:'center',width:80,formatter: rowformatter">操作</th>
                </tr>
                </thead>
            </table>
        </div>
    </div>
</div>
<!--头工具项-->
<div id="tb" style="padding:2px 5px;">
    项目名: <input class="easyui-textbox" name="title" id="title" style="width:110px">
    <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-search" id="search" stab="ttAll">查找</a>
</div>
<div id="w" class="easyui-window" title="任务详情" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:600px;height:400px;padding:10px;">
    <div style="padding:10px 10px 10px 10px" id="itemDetail">
        <div class="easyui-panel" title="任务描述" id="description" style="margin-bottom: 5px;padding:10px;">

        </div>
        <div class="easyui-panel" title="任务阶段描述">
            <table border="1px" cellpadding="0" cellspacing="0" bordercolor= "#95B8E7">
                <tr>
                    <th>阶段序号</th>
                    <th>阶段名称</th>
                    <th>支付金额</th>
                    <th>阶段成果要求</th>
                    <th>阶段状态</th>
                    <th>阶段作品</th>
                </tr>
                <tbody id="itemstage">

                </tbody>

            </table>
        </div>
    </div>
</div>
<script>
    function rowformatter(value,row,index){
        return '<a href="#" onclick="showItemDetail('+index+')">查看</a>';
    }
    function rowformatter4(value,row,index){

        return '<a href="#" onclick="showItemDetail('+index+')">查看</a>&nbsp;&nbsp;' +
                '<a href="#" onclick="examine('+row.id+','+ row.userId +',\''+row.title+'\','+index+')">审核通过</a>&nbsp;&nbsp;';
    }
    function rowformatter5(value,row,index){
        if(row.isRecom == 101001){
            return '<a href="#" onclick="showItemDetail('+index+')">查看</a>&nbsp;&nbsp;' +
                    '<a href="#" onclick="unrecommend('+row.id+',\''+row.title+'\','+index+')">取消推荐</a>';
        }else{
            return '<a href="#" onclick="showItemDetail('+index+')">查看</a>&nbsp;&nbsp;' +
                    '<a href="#" onclick="recommend('+row.id+',\''+row.title+'\','+index+')">推荐</a>';
        }

    }
    function showItemDetail(index){
        var currenttab =  $("#search").attr("stab");
        //本行数据
        var row = $('#'+currenttab).datagrid('getData').rows[index];
        $("#description").html(row.description);
        //阶段数据
        $.post("${path}/task/detail.do",{
            itemId:row.id
        },function(data){
            var list = data.list;
            if(list.length > 0){
                var htmlstr = "";
                for(var i=0;i<list.length;i++){
                    var obj = list[i];
                    var deliverable = "";
                    if(obj.deliverable != ''){
                        deliverable+="<img src='${path}/style/common/images/zip.jpg' width='40px' height='40px'><br/>"+obj.deliverable.substring(obj.deliverable.lastIndexOf("/")+1);
                    }
                    htmlstr+="<tr>" +
                            "<td>"+obj.stage_id+"</td>" +
                            "<td>"+obj.stage+"</td>" +
                            "<td>"+obj.scale*obj.totalPrice/100+"</td>" +
                            "<td>"+obj.resultClaim+"</td>" +
                            "<td>"+obj.status+"</td>" +
                            "<td>"+deliverable+"</td>" +
                            "</tr>";
                }
                $("#itemstage").html(htmlstr);
            }else{
                $("#itemstage").html("暂无阶段");
            }
        },"json");
        $('#w').window('open');
    }
</script>
</body>
</html>
